﻿using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Caliburn.MusicPlayer.UserControls
{
    /// <summary>
    /// RightCornerControl.xaml 的交互逻辑
    /// </summary>
    public partial class RightCornerControl : UserControl
    {
        public RightCornerControl()
        {
            InitializeComponent();
        }

        public RelayCommand MiniumCommand
        {
            get
            {
                return (RelayCommand)GetValue(MiniumCommandProperty);
            }
            set
            {
                SetValue(MiniumCommandProperty, value);
            }
        }
        
        public static readonly DependencyProperty MiniumCommandProperty =
            DependencyProperty.Register("MiniumCommand", typeof(RelayCommand), typeof(RightCornerControl), new PropertyMetadata(null));


        public RelayCommand CloseCommad
        {
            get
            {
                return (RelayCommand)GetValue(CloseCommadProperty);
            }
            set
            {
                SetValue(CloseCommadProperty, value);
            }
        }
        
        public static readonly DependencyProperty CloseCommadProperty =
            DependencyProperty.Register("CloseCommad", typeof(RelayCommand), typeof(RightCornerControl), new PropertyMetadata(null));



        public RelayCommand MaxiumCommand
        {
            get
            {
                return (RelayCommand)GetValue(MaxiumCommandProperty);
            }
            set
            {
                SetValue(MaxiumCommandProperty, value);
            }
        }

        public static readonly DependencyProperty MaxiumCommandProperty =
            DependencyProperty.Register("MaxiumCommand", typeof(RelayCommand), typeof(RightCornerControl), new PropertyMetadata(null));



        //private void btn_min_Click(object sender, RoutedEventArgs e)
        //{
        //    MiniumCommand?.Execute(null);
        //    e.Handled = true;
        //}

        private void btn_close_Click(object sender, RoutedEventArgs e)
        {
            CloseCommad?.Execute(null);
        }

        private void btn_min_Click(object sender, MouseButtonEventArgs e)
        {
            MiniumCommand?.Execute(null);
        }

        private void btn_max_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            MaxiumCommand?.Execute(null);
        }
    }
}
